package com.minsf.rpc.fault.tolerant;

import com.minsf.rpc.model.RpcResponse;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * @Description 静默处理
 * @Author minify
 * @Date 2024/4/1 20:19
 * @Project sf-rpc
 */
@Slf4j
public class FailSafeTolerantStrategy implements TolerantStrategy {

    /**
     * @param context 上下文
     * @param e 异常
     * @return
     */
    @Override
    public RpcResponse doTolerant(Map<String, Object> context, Exception e) {
        log.error("静默处理异常 {}", e.getMessage());
        return new RpcResponse();
    }
}
